//	Project:	HexTower
//	File:		BaseObject.h
//	Author:		Mustafa Aldoori
//	Purpose:	Declaration of all Base Objects.

#pragma once
#include "IBaseObject.h"

// Enumeration to assign types to objects depending on which Diamond level is unlocked.
enum OBJECT_LEVEL { OBJ_BASE, OBJ_1_DIAM, OBJ_2_DIAM, OBJ_3_DIAM, 
					OBJ_4_DIAM, OBJ_5_DIAM, OBJ_6_DIAM, OBJ_7_DIAM };

class CBaseObject :	public IBaseObject
{
private:
	int				m_nLayerType;

	// Position
	float			m_fX;
	float			m_fY;

	// Velocity
	float			m_fVelX;
	float			m_fVelY;

	// Size
	unsigned int	 m_unWidth;
	unsigned int	 m_unHeight;

	// Image
	int				m_nImageID;
	unsigned int	m_unColor;
	RECT			m_rSourceRect;

	// Gravity
	bool			m_bIsGravityOn;

public:
	CBaseObject( void );
	virtual ~CBaseObject( void );

	virtual void Update( float fElapsed );
	virtual void Render( void );

	virtual bool CheckCollision( IBaseObject * pBase );
	
	virtual RECT	GetRect( );
	virtual int		GetType( void )					{ return m_nType;			}

	float			GetX( void ) const				{ return m_fX;				}
	float			GetY( void ) const				{ return m_fY;				}
	float			GetVelX( void ) const			{ return m_fVelX;			}
	float			GetVelY( void )	const			{ return m_fVelY;			}
	unsigned int	GetWidth( void ) const			{ return m_unWidth;			}		 
	unsigned int	GetHeight( void ) const			{ return m_unHeight;		}
	int				GetImageID( void ) const		{ return m_nImageID;		}
	unsigned int	GetColor( void ) const			{ return m_unColor;			}
	RECT			GetSourceRect( void ) const		{ return m_rSourceRect;		}
	bool			GetGravityBool( void )			{ return m_bIsGravityOn;	}
	int				GetLayerType( void )			{ return m_nLayerType;		}

	virtual void SetScalar( float timeScalar )		{	m_fTimeScalar = timeScalar;	}

	void	SetX( float x )  						{  m_fX	= x;					}
	void	SetY( float y )  						{  m_fY = y;					}
	void	SetVelX( float vx ) 					{  m_fVelX = vx;				}
	void	SetVelY( float vy )	 					{  m_fVelY = vy;				}
	void	SetWidth( unsigned int w )	 			{  m_unWidth = w;				}		 
	void	SetHeight( unsigned int h )				{  m_unHeight = h;				}
	void	SetImageID( int id )					{  m_nImageID = id;				}
	void	SetColor( unsigned int c )	 			{  m_unColor = c;				}
	void	SetSourceRect( RECT r )					{  m_rSourceRect = r;			}
	void	SetGravityBool( bool g )				{  m_bIsGravityOn = g;			}
	void	SetLayerType( int nLayerNum )			{	m_nLayerType = nLayerNum;	}

protected:
	int m_nType;
	float m_fTimeScalar;

};

